export let watchers = [];

export default class ComputedWatcher {
  constructor(vm, attValue, callback) {
    this.vm = vm;
    this.name = attValue;
    this.callback = callback;
    this.oldValue = this.vm.getValue(this.name);
    watchers.push(this);
  }
  update() {
    this.callback(this.vm.computed[this.name].call(this.vm));
  }
}
